﻿<phone:PhoneApplicationPage 
    x:Class="TourGuideApp.StopsListPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True" Loaded="PhoneApplicationPage_Loaded">
	<phone:PhoneApplicationPage.Resources>
		<DataTemplate x:Key="stopTemplate">
			<Grid HorizontalAlignment="Left" Height="256" VerticalAlignment="Top" Width="462">
				<StackPanel Orientation="Horizontal" Width="458" Margin="2,0" Height="83" VerticalAlignment="Top">
					<Image Name="thumbNailImage" Source="{Binding pointOfInterest.ThumbNailURI}"  Width="72"  Margin="0,2,0,0" />
					<TextBlock Text="{Binding title}" TextWrapping="Wrap" VerticalAlignment="Top" Width="323" Height="49" HorizontalAlignment="Left"/>
					<Grid Margin="0,11,0,0" Width="28" Height="38" VerticalAlignment="Top">
						<Ellipse Fill="{StaticResource PhoneAccentBrush}" Stroke="{StaticResource PhoneAccentBrush}" Height="34" VerticalAlignment="Center" RenderTransformOrigin="0.462,0.714" Margin="-1,0,-9,0"/>
						<StackPanel Margin="2,6,-9,6" Orientation="Horizontal" d:LayoutOverrides="Height">
							<TextBlock Text="{Binding duration}" HorizontalAlignment="Center" VerticalAlignment="Center" Height="26" Width="18"/>
							<TextBlock Width="25" Text="mins" FontSize="8" Margin="0,8,0,3"/>
						</StackPanel>
					</Grid>
				</StackPanel>
				<TextBlock Text="{Binding address}" TextWrapping="Wrap" Style="{StaticResource PhoneTextAccentStyle}" Height="29" HorizontalAlignment="Left" Margin="77,54,0,0" Width="343" FontSize="12" VerticalAlignment="Top"/>
				<TextBlock Text="{Binding pointOfInterest.longDescription}" TextWrapping="Wrap" Style="{StaticResource PhoneTextSmallStyle}" Margin="0,87,2,29"/>
			</Grid>
		</DataTemplate>
	</phone:PhoneApplicationPage.Resources>
	
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="{StaticResource AppName}" Style="{StaticResource PhoneTextNormalStyle}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <ListBox Name="stopsListBox" ItemTemplate="{StaticResource stopTemplate}" Height="690" HorizontalAlignment="Left" VerticalAlignment="Top" Width="456" ItemsSource="{Binding stopCollection}" SelectionChanged="listBox1_SelectionChanged" />
        </Grid>
    </Grid>
 
    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

</phone:PhoneApplicationPage>
